Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly calculte address for 0x800000 onwards in ogc_card_writepage() #121

Merged
merged 1 commit into from
Nov 16, 2021

Conversation

suloku
Copy link
Contributor

@suloku suloku commented Oct 11, 2021

Extrems pushed a commit to extremscorner/libogc-rice that referenced this pull request Oct 11, 2021
@DacoTaco
Copy link
Member

DacoTaco commented Oct 11, 2021

i never did try anything with my big ben card, but i can test this. i assume reading works ( this is ogc_readsegment? ) , since it has the same code/bitwise operations there?

@DacoTaco
Copy link
Member

@suloku : you seem to have pulled in changes from elsewhere in the branch of your open pull request (in this case main).
you'll need to either remove the commits, or remake this pull request using a different branch that doesn't have all this noise.

@suloku
Copy link
Contributor Author

suloku commented Oct 15, 2021

Corrected, everything should be fine now.

Actually I was consistently failing to write at block 1024 (or more precisely, content wasn't written to block 1024,). After some tests I noticed the content was being written to block 0 onwards after block 1024, then I noticed card_writepage and card_readsegment had different calculations for the offset card command.
I did some offset calcultations for blocks 0->2048 on a simple C snippet, that's where I confirmed the error and noticed card_readsegment was correctly doing the job. I made the changes and afterwards it worked fine.
I'm pretty sure a simple gci restore would also fail, I'll confirm later by writing a 1025 block file to an empty memory card and then trying to restore another gci file. This will most likely corrupt the card.

@DacoTaco
Copy link
Member

DacoTaco commented Nov 16, 2021

confirmed by testing the following :

  • make backup with GCMM
  • alter backup in hex editor past 0x800000
  • restore backup (old libogc gave an error in GCMM, i suspect because it couldn't verify the byte being written correctly)
  • backup again
  • verify in last backup altered data is there

thanks for the contribution !

@DacoTaco DacoTaco merged commit ba0a035 into devkitPro:master Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants